include ../Makefile.shared

define PROJ_mnlearnw
  SOURCES = mnlearnw.ml
  RESULT = mnlearnw
endef
export PROJ_mnlearnw

define PROJ_mnsetw
  SOURCES = mnsetw.ml
  RESULT = mnsetw
endef
export PROJ_mnsetw

# If the environment does not define subprojects to handle,
# then set a default
ifndef SUBPROJS
  export SUBPROJS = mnlearnw mnsetw
endif

export CLIBS=lbfgs_stubs pll_stubs
export LIBS=ext str unix expat data lbfgs mn pll bn

# Default target to use
all: nc
	cp $(SUBPROJS) $(BINDIR)

# Catch-all target will be applied to all subprojects automatically
%:
	@$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@
